package com.ccjq.jq167.student.utils;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

public class DbConfigReader {

    private Properties prop;

    public DbConfigReader()
    {
        this.read();
    }

    //读取配置文件
    private void read()
    {
        prop=new Properties();
        //调用方法获取流
        InputStream is=DbConfigReader.class.getResourceAsStream("/dbProperties.properties");

        //调用load方法将字节输入流当参数传递进去
        try{
            prop.load(is);
        }
        catch(IOException e){
            e.printStackTrace();
        }
    }

    public String getValue(String key){
        return prop.getProperty(key);
    }

}
